<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能机器人</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f2f2f2;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
        }

        h1 {
            color: #333;
        }

        form {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        label {
            font-size: 16px;
            margin-bottom: 5px;
            color: #333;
        }

        input {
            padding: 10px;
            font-size: 14px;
            border: 1px solid #ccc;
            border-radius: 5px;
            margin-bottom: 15px;
        }

        button {
            padding: 10px;
            font-size: 16px;
            background-color: #4caf50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        button:hover {
            background-color: #45a049;
        }

        h2 {
            margin-top: 20px;
            color: #333;
        }

        p {
            font-size: 16px;
            color: #555;
        }
    </style>

</head>
<body>
    <h1>智能回答机器人</h1>
    <form action="/ask" method="post">
        <label for="user_input">输入问题：</label>
        <input type="text" id="user_input" name="user_input" required>
        <button type="submit">提交</button>
    </form>

    {% if user_input %}
        <h2>你的问题：</h2>
        <p>{{ user_input }}</p>
        <h2>模型的答案：</h2>
        <p>{{ answer }}</p>
    {% endif %}
</body>
</html>
